package com.xcf.service.business.common.companymanagement.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcf.dao.DaoSupport;
import com.xcf.entity.Page;
import com.xcf.service.business.common.companymanagement.CompanyManagementService;
import com.xcf.util.PageData;
@Service("CompanyManagementServiceImpl")
public class CompanyManagementServiceImpl implements CompanyManagementService {
@Resource(name="daoSupport")
private DaoSupport daosupport;
	//列表的查询及显示
	@Override
	public List<PageData> seach(Page pd) throws Exception {
		
		return (List<PageData>) daosupport.findForList("CompanyManagementMapper.seach", pd);
	}

	//新增一条
		@Override
		public void addcompany(PageData pd) {
			try {
				daosupport.save("CompanyManagementMapper.save", pd);
			} catch (Exception e) {
				
				e.printStackTrace();
			}
			
		}
		//去修改页面
		@Override
		public PageData seacById(PageData pd) throws Exception {
			
			
				return (PageData) daosupport.findForObject("CompanyManagementMapper.seacById", pd);
		}
		//修改保存按钮
		@Override
		public void savaU(PageData pd) {
			try {
				daosupport.update("CompanyManagementMapper.editU", pd);
			} catch (Exception e) {
				
				e.printStackTrace();
			}
			
		} 
		//删除
		@Override
		public void delete(PageData pd) {
			try {
				daosupport.delete("CompanyManagementMapper.deleteU", pd);
			} catch (Exception e) {
				
				e.printStackTrace();
			}
			
		}

}
